Security News
Supply Chain Attack Detected in @solana/web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
robust-point-in-polygon
Advanced tools
Exactly test if a point is inside, outside or on the boundary of a polygon
Exactly determines if a point is contained in a 2D polygon.
var classifyPoint = require("robust-point-in-polygon")
var polygon = [ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ] ]
console.log(
classifyPoint(polygon, [1.5, 1.5]),
classifyPoint(polygon, [1, 2]),
classifyPoint(polygom, [100000, 10000]))
Output:
-1 0 1
npm install robust-point-in-polygon
require("robust-point-in-polygon")(loop, point)
Tests if a point is contained in the interior of a simple polygon
loop
is an array of vertices for the polygonpoint
is a 2D point which is classified against the polygonReturns An integer which determines the position of point
relative to polygon
. This has the following interpretation:
-1
if point
is contained inside loop
0
if point
is on the boundary of loop
1
if point
is outside loop
(c) 2014 Mikola Lysenko. MIT License
FAQs
Exactly test if a point is inside, outside or on the boundary of a polygon
We found that robust-point-in-polygon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.